Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

[TxPool] Fix duplicate transactions in account #575

Merged
merged 7 commits into from
Jun 10, 2022

Conversation

dbrajovic
Copy link
Contributor

@dbrajovic dbrajovic commented Jun 3, 2022

Description

This PR fixes the issue of two identical transactions ending up back-to-back inside an account. This bug is the true source of the numerous failed to apply tx: incorrect nonce errors.

The second transaction is a gossip of the first, but because indexing happens in handleEnqueueRequest both of them complete the preceding call to addTx bypassing the (now deprecated) check for ErrAlreadyKnown.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Additional comments

Fixes EDGE-585

@dbrajovic dbrajovic added the hotfix Major bug fix that should be merged ASAP label Jun 3, 2022
@dbrajovic dbrajovic requested a review from 0xAleksaOpacic June 3, 2022 09:47
@dbrajovic dbrajovic self-assigned this Jun 3, 2022
Copy link
Contributor

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

txpool: failed to apply tx: incorrect nonce, I banish you to the shadow realm 🚀

Copy link
Contributor

@Kourin1996 Kourin1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

txpool/txpool.go Show resolved Hide resolved
@dbrajovic dbrajovic merged commit 5249831 into develop Jun 10, 2022
@dbrajovic dbrajovic deleted the hotfix/txpool-double-nonce branch June 10, 2022 13:05
@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotfix Major bug fix that should be merged ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants